/* 页面居中容器 */
.game {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.game-container {
  max-width: 1200px;
  width: 100%;
  text-align: center;
}

/* 第一行：开始新的一局 */
.game-top {
  margin-bottom: 20px;
}

.reset-button {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #999;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.goback-button {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: #999;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  margin-left: 20px;
}

.reset-button:hover {
  background-color: #777;
}

/* 第二行：状态 */
.game-status {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 500;
  color: #333;
}

/* 棋盘容器 */
.wrapper {
  margin: 0 auto 30px auto;
  display: inline-block;
}

/* 每行棋盘清除浮动 */
.board-row:after {
  clear: both;
  content: '';
  display: table;
}

/* 单个方格 */
.square {
  width: 60px;
  height: 60px;
  background: #fff;
  border: 1px solid #999;
  font-size: 32px;
  font-weight: 400;
  line-height: 60px;
  text-align: center;
  float: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.square:hover {
  background-color: #f0f0f0;
}

/* 历史记录：一列显示 */
.game-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 300px;
  margin: 0 auto;
  text-align: left;
  font-family: sans-serif;
}

.history-item {
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-description {
  font-weight: 500;
}

.history-action {
  color: #5aa0ff;
  text-decoration: underline;
  text-decoration-color: #5aa0ff;
  text-underline-offset: 3px;
  font-size: 14px;
  transition: color 0.2s, text-decoration-color 0.2s;
  cursor: pointer;
}

.history-action:hover {
  color: #2f7bff;
  text-decoration-color: #2f7bff;
}